package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysUserSalaryMapper;
import com.ruoyi.system.domain.SysUserSalary;
import com.ruoyi.system.service.ISysUserSalaryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户薪资计算Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class SysUserSalaryServiceImpl implements ISysUserSalaryService 
{
    @Autowired
    private SysUserSalaryMapper sysUserSalaryMapper;

    /**
     * 查询用户薪资计算
     * 
     * @param userId 用户薪资计算主键
     * @return 用户薪资计算
     */
    @Override
    public SysUserSalary selectSysUserSalaryByUserId(Long userId)
    {
        return sysUserSalaryMapper.selectSysUserSalaryByUserId(userId);
    }

    /**
     * 查询用户薪资计算列表
     * 
     * @param sysUserSalary 用户薪资计算
     * @return 用户薪资计算
     */
    @Override
    public List<SysUserSalary> selectSysUserSalaryList(SysUserSalary sysUserSalary)
    {
        return sysUserSalaryMapper.selectSysUserSalaryList(sysUserSalary);
    }

    /**
     * 新增用户薪资计算
     * 
     * @param sysUserSalary 用户薪资计算
     * @return 结果
     */
    @Override
    public int insertSysUserSalary(SysUserSalary sysUserSalary)
    {
        return sysUserSalaryMapper.insertSysUserSalary(sysUserSalary);
    }

    /**
     * 修改用户薪资计算
     * 
     * @param sysUserSalary 用户薪资计算
     * @return 结果
     */
    @Override
    public int updateSysUserSalary(SysUserSalary sysUserSalary)
    {
        sysUserSalary.setUpdateTime(DateUtils.getNowDate());
        return sysUserSalaryMapper.updateSysUserSalary(sysUserSalary);
    }

    /**
     * 批量删除用户薪资计算
     * 
     * @param userIds 需要删除的用户薪资计算主键
     * @return 结果
     */
    @Override
    public int deleteSysUserSalaryByUserIds(String userIds)
    {
        return sysUserSalaryMapper.deleteSysUserSalaryByUserIds(Convert.toStrArray(userIds));
    }

    /**
     * 删除用户薪资计算信息
     * 
     * @param userId 用户薪资计算主键
     * @return 结果
     */
    @Override
    public int deleteSysUserSalaryByUserId(Long userId)
    {
        return sysUserSalaryMapper.deleteSysUserSalaryByUserId(userId);
    }
}
